<template>
	<scroll-view scroll-y="true" class="content">
		<view style="margin-left: 3.5%">
			<image src="http://113.142.144.25:9301/statics/appimg/service_bg_head_new.png" style="height: 270rpx; width: 93vw; margin-top: 20rpx"></image>
		</view>
		<!-- 科技资源  已迁移到首页-->
		<!-- <view class="menu_bar" >
			<view style="margin-top: 15rpx;"><text class="service_title">科技资源</text></view>
			<view class="devideline"></view>
			<view class="menu_list" v-for="(item, index) in menuList" :key="index" 
						@click=" index == 0 ? zoneCenter()//科技园区
								:index == 1 ? talentCenter()//科技人才
								:index == 2 ? projectCenter()//科技项目
								:index == 3 ? machineList()//科学仪器
								:''">
				<view>
					<image class="icon_bg" :src= "item.icon"></image>
				</view>
				<view class="menu_lable">
					<text>{{item.name}}</text>
				</view>
			</view>
		</view> -->
		<!-- 科技服务 -->
		<view class="opration_bar">
			<view style="margin-top: 15rpx"><text class="service_title">仪器服务</text></view>
			<view class="devideline"></view>
			<view
				class="opration_list"
				v-for="(item, index) in oprationList"
				:key="index"
				@click="
					index == 0
						? machineCenter() //仪器服务
						: index == 1
						? experienceService() //实验服务
						: index == 2
						? checkService() //检测服务
						: ''
				"
			>
				<view style="text-align: center">
					<image class="opration_icon_bg" :src="item.icon"></image>
				</view>
				<view class="opration_lable" style="text-align: center">
					<text>{{ item.name }}</text>
				</view>
			</view>
		</view>
		<view class="opration_bar">
			<view style="margin-top: 15rpx"><text class="service_title">人才服务</text></view>
			<view class="devideline"></view>
			<view
				class="opration_list"
				v-for="(item, index) in oprationList1"
				:key="index"
				@click="
					index == 0
						? talentWanted() //人才需求发布
						: index == 1
						? jobWanted() //求职信息发布
						: ''
				"
			>
				<view style="text-align: center">
					<image class="opration_icon_bg" :src="item.icon"></image>
				</view>
				<view class="opration_lable" style="text-align: center">
					<text>{{ item.name }}</text>
				</view>
			</view>
		</view>
		<view class="opration_bar" style="height: 500rpx">
			<view style="margin-top: 15rpx"><text class="service_title">成果转化服务</text></view>
			<view class="devideline"></view>
			<view
				class="opration_list"
				v-for="(item, index) in oprationList2"
				:key="index"
				@click="
					index == 0
						? achievementCheck() //科技成果登记
						: index == 1
						? achievementCheck() //科学技术奖申报
						: index == 2
						? achievementCheck() //技术合同服务
						: index == 3
						? achievementNeed() //成果需求发布
						: index == 4
						? achievementExchange() //可转换成果登记
						: ''
				"
			>
				<view style="text-align: center">
					<image class="opration_icon_bg" :src="item.icon"></image>
				</view>
				<view class="opration_lable" style="text-align: center">
					<text>{{ item.name }}</text>
				</view>
			</view>
		</view>
		<view class="opration_bar" style="height: 350rpx">
			<view style="margin-top: 15rpx"><text class="service_title">申报服务</text></view>
			<view class="devideline"></view>
			<view
				class="opration_list"
				v-for="(item, index) in oprationList3"
				:key="index"
				@click="
					index == 0
						? kcptReport() //科创平台申报
						: index == 1
						? projectSolicitation() //科技项目征集
						: index == 2
						? talentCollection() //科技人才征集
						: index == 3
						? cuponCenter() //企业培育申请
						: ''
				"
			>
				<view style="text-align: center">
					<image class="opration_icon_bg" :src="item.icon"></image>
				</view>
				<view class="opration_lable" style="text-align: center">
					<text>{{ item.name }}</text>
				</view>
			</view>
		</view>
		<view class="opration_bar">
			<view style="margin-top: 15rpx"><text class="service_title">其他服务</text></view>
			<view class="devideline"></view>
			<view
				class="opration_list"
				v-for="(item, index) in oprationList4"
				:key="index"
				@click="
					index == 0
						? techSearch() //仪器服务
						: index == 1
						? companyEvaluation() //企业测评
						: ''
				"
			>
				<view style="text-align: center">
					<image class="opration_icon_bg" :src="item.icon"></image>
				</view>
				<view class="opration_lable" style="text-align: center">
					<text>{{ item.name }}</text>
				</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
export default {
	data() {
		return {
			title: '',
			menuList: [
				{
					name: '创新平台',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/icon_zone_new.png'
				},
				{
					name: '科技人才',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/icon_rencai_new.png'
				},
				{
					name: '科技成果',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/icon_project_new.png'
				},
				{
					name: '科学仪器',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/icon_machine_new.png'
				}
			],
			oprationList: [
				{
					name: '仪器共享服务',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/opration_icon_yuyue_new.png'
				},
				{
					name: '实验仪器服务',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/opration_icon_shiyan_new.png'
				},
				{
					name: '检测仪器服务',
					icon: 'http://113.142.144.25:9301/statics/appimg/service/opration_icon_jiance_new.png'
				}
			],
			oprationList1: [
				{
					name: '人才需求发布',
					icon: '../../static/images/ic_job_wanted.png'
				},
				{
					name: '人才求职发布',
					icon: '../../static/images/ic_person_want.png'
				}
			],
			oprationList2: [
				{
					name: '科技成果登记',
					icon: '../../static/images/ic_kjcgdj.png'
				},
				{
					name: '科学技术奖申报',
					icon: '../../static/images/ic_kxjsj.png'
				},
				{
					name: '技术合同服务',
					icon: '../../static/images/ic_jsht.png'
				},
				{
					name: '成果需求发布',
					icon: '../../static/images/ic_cgxqfb.png'
				},
				{
					name: '可转化成果登记',
					icon: '../../static/images/ic_kjcgzh.png'
				}
			],
			oprationList3: [
				{
					name: '科创平台申报',
					icon: '../../static/images/ic_kcpt.png'
				},
				{
					name: '科技项目征集',
					icon: '../../static/images/ic_qypy.png'
				},
				{
					name: '科技人才征集',
					icon: '../../static/images/ic_rczj.png'
				},
				// {
				// 	name: '企业培育申请',
				// 	icon: '../../static/images/ic_qypy.png'
				// }
			],
			oprationList4: [
				{
					name: '科技项目查新',
					icon: '../../static/images/ic_kjcx.png'
				},
				{
					name: '企业测评服务',
					icon: '../../static/images/ic_qycp.png'
				}
			],
			userType: ''
		};
	},
	onLoad() {},
	methods: {
		getUser() {
			const value = uni.getStorageSync('userInfo');
			if (value) {
				this.userType = value.login_user.member.userType;
				return true;
			} else {
				uni.showToast({
					duration: 1000,
					title: '你还未登录请先登录',
					icon: 'none'
				});
				setTimeout(() => {
					uni.navigateTo({
						url: '/subpages/pages/register/login_province'
					});
				}, 1000);
				return false;
			}
		},
		//科技资源
		zoneCenter() {
			uni.navigateTo({
				url: '/subpages/pages/resource/zone/zone'
			});
		},
		talentCenter() {
			uni.navigateTo({
				url: '/subpages/pages/service/techPerson'
			});
		},
		machineList() {
			uni.navigateTo({
				url: '/subpages/pages/machineCenter/machine_list?orderType=' + '0'
				// url:'/pages/machineCenter/machine_list?orderType='+'0'
			});
		},
		projectCenter() {
			uni.navigateTo({
				url: '/subpages/pages/achivement/achivement_list'
				// url:'/pages/reportList/project/projectList?type=1'
			});
		},
		//科技服务服务
		// 仪器服务
		machineCenter() {
			uni.navigateTo({
				url: '/subpages/pages/machineCenter/machine_list?orderType=' + '1'
			});
		},
		//实验服务
		experienceService() {
			uni.navigateTo({
				url: '/subpages/pages/machineCenter/machine_list?orderType=' + '3'
			});
		},
		// 检测服务
		checkService() {
			uni.navigateTo({
				url: '/subpages/pages/machineCenter/machine_list?orderType=' + '2'
			});
		},
		//实验服务
		projectSolicitation() {
			uni.navigateTo({
				url: '/subpages/pages/serviceReport/kjxmReport/index'
			});
		},
		// 检测服务
		talentCollection() {
			uni.navigateTo({
				url: '/subpages/pages/serviceReport/kjrcReport/index'
			});
		},
		//政策法规
		morePolicy() {
			uni.switchTab({
				url: '/pages/policy/policy_list'
			});
		},
		// 常见问题
		commonService() {
			uni.showModal({
				title: '温馨提示',
				content: '请前往电脑端提交成果转化信息，电脑端地址：https:www.********.com',
				confirmText: '我知道了', // 确认按钮的文字
				showCancel: false, // 是否显示取消按钮，默认为 true
				confirmColor: '#007aff',
				success: (res) => {
					if (res.confirm) {
						// console.log('comfirm') //点击确定之后执行的代码
					} else {
						// console.log('cancel') //点击取消之后执行的代码
					}
				}
			});
		},
		//在线咨询
		askOnline() {
			uni.showToast({
				icon: 'none',
				title: '努力开发中，敬请期待！',
				duration: 2000
			});
		},
		// 创新券
		cuponCenter() {
			// uni.navigateTo({
			// 	url:'/subpages/pages/cupon/cupon_list'
			// })
			uni.showModal({
				title: '温馨提示',
				content: '请前往电脑端完成申报，电脑端地址：http://113.142.144.25:8082',
				confirmText: '我知道了', // 确认按钮的文字
				showCancel: false, // 是否显示取消按钮，默认为 true
				confirmColor: '#007aff',
				success: (res) => {
					if (res.confirm) {
						// console.log('comfirm') //点击确定之后执行的代码
					} else {
						// console.log('cancel') //点击取消之后执行的代码
					}
				}
			});
		},
		zhongjieService() {
			uni.navigateTo({
				url: '/subpages/pages/betweenService/between_service'
			});
		},
		//人才服务
		//人才招聘发布
		talentWanted() {
			let res = this.getUser();
			if (res) {
				if (this.userType != '2') {
					uni.showModal({
						title: '提示',
						content: '您不是企业用户，无法发布招聘信息，请先确认账号！',
						showCancel: false
					});
				} else {
					uni.navigateTo({
						url: '/subpages/pages/service/talentService/talentWanted'
					});
				}
			}
		},
		//人才求职发布
		jobWanted() {
			let res = this.getUser();
			if (res) {
				if (this.userType != '1') {
					uni.showModal({
						title: '提示',
						content: '您不是个人用户，无法发布求职信息，请先确认账号！',
						showCancel: false
					});
				} else {
					uni.navigateTo({
						url: '/subpages/pages/service/talentService/jobWanted'
					});
				}
			}
		},
		//成果转化服务
		//科技城固登记
		achievementCheck() {
			uni.showModal({
				title: '温馨提示',
				content: '请前往电脑端完成申报，电脑端地址：http://113.142.144.25:8082',
				confirmText: '我知道了', // 确认按钮的文字
				showCancel: false, // 是否显示取消按钮，默认为 true
				confirmColor: '#007aff',
				success: (res) => {
					if (res.confirm) {
						// console.log('comfirm') //点击确定之后执行的代码
					} else {
						// console.log('cancel') //点击取消之后执行的代码
					}
				}
			});
		},
		// 成果需求发布
		achievementNeed() {
			// if(this.userType != '2'){
			// 	uni.showModal({
			// 		title:'提示',
			// 		content:'您不是企业用户，无法发布成果需求，请先确认账号！',
			// 		showCancel:false
			// 	})
			// }else{
			uni.navigateTo({
				url: '/subpages/pages/cgzh/needPublish'
			});
			// }
		},
		achievementExchange() {
			// if(this.userType != '2'){
			// 	uni.showModal({
			// 		title:'提示',
			// 		content:'您不是企业用户，无法发布成果需求，请先确认账号！',
			// 		showCancel:false
			// 	})
			// }else{
			uni.navigateTo({
				url: '/subpages/pages/cgzh/cgzhdj'
			});
			// }
		},
		//申报服务
		//科创平台申报
		kcptReport() {
			uni.navigateTo({
				url: '/subpages/pages/serviceReport/kcptReport/index'
			});
		},
		//其他服务
		//企业测评
		companyEvaluation() {
			let res = this.getUser();
			res &&
				uni.navigateTo({
					url: '/subpages/pages/compamyEvaluation/home'
				});
		},
		//科技查新
		techSearch() {
			let res = this.getUser();
			res &&
				uni.navigateTo({
					url: '/subpages/pages/projectSearch/index'
				});
		}
	}
};
</script>

<style>
.content {
	width: 100%;
	height: 100vh;
	background: #e0e0e0;
	padding-top: 1rpx;
	padding-bottom: 20rpx;
}

.head {
	position: absolute;
	top: 20rpx;
	left: 3.5%;
	display: flex;
	width: 93vw;
	margin: 20rpx auto;
	height: 70rpx;
	border-radius: 30rpx;
	background-color: #fff;
	text-align: center;
}

.search_view {
	margin: 0 auto;
	z-index: 999;
}

.search {
	height: 40rpx;
	padding-top: 15rpx;
	font-size: 25rpx;
	float: left;
}

.title_lable {
	position: absolute;
	top: 15;
	left: 30;
	word-wrap: break-word;
	font-size: 30rpx;
	color: black;
}

.menu_bar {
	height: 300rpx;
	background-color: #fff;
	margin: 15rpx 25rpx;
	padding-top: 5rpx;
	border-radius: 15rpx;
	box-shadow: 5rpx 0rpx 10rpx #d3d3d3;
}

.menu_list {
	width: 130rpx;
	font-size: 28rpx;
	float: left;
	margin-left: 4%;
	padding-top: 10rpx;
	background-color: #fff;
	border-radius: 10rpx;
	padding-bottom: 1rpx;
}

.icon_bg {
	width: 120rpx;
	height: 120rpx;
	border-radius: 50%;
	margin-left: 18%;
	margin-top: 15rpx;
	text-align: center;
}

.menu_icon {
	width: 70rpx;
	height: 70rpx;
	margin-top: 25rpx;
}

.menu_lable {
	font-size: 25rpx;
	margin: 5% auto;
	text-align: center;
	padding-left: 22%;
}

.opration_bar {
	margin: 15rpx 25rpx;
	border-radius: 15rpx;
	height: 300rpx;
	padding-top: 15rpx;
	background-color: #fff;
}

.opration_list {
	font-size: 28rpx;
	float: left;
	margin-left: 4%;
	padding-top: 15rpx;
	background-color: #fff;
}

.opration_icon_bg {
	width: 110rpx;
	height: 110rpx;
	border-radius: 50%;
	margin-top: 5rpx;
	text-align: center;
}

.opration_icon {
	width: 70rpx;
	height: 70rpx;
	margin-left: 2%;
	padding-top: 18rpx;
}

.opration_lable {
	margin: 10rpx auto;
	text-align: center;
	padding-left: 20rpx;
	padding-right: 28rpx;
	font-size: 25rpx;
}

.title_icon {
	width: 35rpx;
	height: 35rpx;
	margin-left: 4%;
}

.service_title {
	font-size: 28rpx;
	padding: 25rpx;
	margin-top: 45rpx;
}

.devideline {
	float: left;
	height: 0.3rpx;
	width: 100%;
	background-color: #eeeeee;
	margin-top: 25rpx;
}
</style>
